<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>利用 CSS 绘制小三角形</title>
    <style>
      div {
        width: 0;
        height: 0;
      }

      .box1 {
        border: 20px solid transparent;
        border-top: 20px solid red;
      }

      .box2 {
        border: 20px solid transparent;
        border-right: 20px solid red;
      }

      .box3 {
        border: 20px solid transparent;
        border-bottom: 20px solid red;
      }

      .box4 {
        border: 20px solid transparent;
        border-left: 20px solid red;
      }
    </style>
  </head>
  <body>
    <div class="box1"></div>
    <div class="box2"></div>
    <div class="box3"></div>
    <div class="box4"></div>
  </body>
</html>
